home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOpus Plus
/
DOpus Plus.iso
/
Enhancements
/
FTPBatch
/
ARexx
/
FTPBatchAdd.dopus5
next >
Wrap
Text File
|
1998-10-18
|
1KB
|
40 lines
/*
$VER: FTPBatchAdd.opus5 1.0 (28.9.98) by Neil Bothwick <neil@wirenet.co.uk>
*/
Usage = 'Usage: rx FTPBatchAdd.opus5 BATCHROOT/A FILE/A'
Usage = Usage'*N*NBATCHROOT:'
Usage = Usage'*N The name of the batchfile, without the suffix as used in invoking FTPBatchLister.dopus5'
Usage = Usage'*NFILE:'
Usage = Usage'*N The full path to the file to be downloaded.'
options results
parse arg batchfile ' ' filepath
if right(batchfile,1) = '?' | filepath = '' then call ExitMsg(Usage)
batchfile = batchfile'.batch'
/* Extract file name and full path */
if upper(left(filepath,6)) = 'FTP://' then filepath = substr(filepath,7)
filename = substr(filepath, lastpos('/',filepath) + 1)
parse var filepath server '/' path
filepath = server'///'path
/* Write to batch file */
if exists(batchfile) then openmode = 'A'
else openmode = 'W'
if ~open(batch,batchfile,openmode) then call ExitMsg('Failed to open file:' batchfile)
if openmode = 'W' then call writeln(batch,'FTPBatchLister1.0')
call writeln(batch,filename)
call writeln(batch,filepath)
call close(batchfile)
exit
/* Exit with a message */
ExitMsg:
parse arg msg
address command 'RequestChoice >NIL: "FTPBatchAdd" "'msg'" "OK"'
exit